package com.motorhome.h5.common.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author: John
 */
@ControllerAdvice
public class ExceptionsHandler {

    private final Logger logger = LoggerFactory.getLogger(ExceptionsHandler.class);

    @ExceptionHandler(value = Exception.class)
    public ModelAndView allExceptionHandle(Exception exception) {
        logger.error("全局异常", exception);
        return new ModelAndView("error/error");
    }

}
